<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue使用之事件处理</title>
    <script src="../vue.min.js" type="text/javascript"></script>
</head>
<body>
<div id="app">
    <!--<input type="text" v-model="value" @change="change" />-->
    <!--<input type="text" v-model="value" @change="change('hello')" />-->
    <input type="text" v-model="value" @change.prevent="change('hello')" />
</div>

<script type="text/javascript">
    var app=new Vue({
        el: '#app',
        data:{
            value:''
        },
        methods:{
            change:function (val) {
                //e.preventDefault();   //阻止页面自动加载
                // console.log(e);
                // console.log(this.value);
                console.log(val);
            }
        }
    })
</script>
</body>
</html>